<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<aside>
    <div id="sidebar1" class="sidebar1">
        <div id="nav-wrapper">
            <ul class="nav-list1">
                ${sessionScope.menuHtml}
            </ul>
        </div>
    </div>
</aside>
<script type="text/javascript" charset="utf-8">
    $(".nav-list1").on("click", function (event) {
        var closest_a = $(event.target).closest("a");
        if (!closest_a || closest_a.length == 0) {
            return
        }
        if (!closest_a.hasClass("dropdown-toggle")) {
            return
        }
        var closest_a_next = closest_a.next().get(0);
        if (!$(closest_a_next).is(":visible")) {
            var closest_ul = $(closest_a_next.parentNode).closest("ul");
            closest_ul.find("> .open > .submenu").each(function () {
                if (this != closest_a_next && !$(this.parentNode).hasClass("active")) {
                    $(this).slideUp(150).parent().removeClass("open")
                }
            });
        }
        $(closest_a_next).slideToggle(150).parent().toggleClass("open");
        return false;
    });
</script>